<template>
  <div>
    <form action="" ref="xx">
      <span>用户名:</span> <input type="text" name="name"  v-model="form.name"><br><br>
      <span>密码:</span> <input type="text" name="password" v-model="form.password">
    </form>
  </div>
</template>

<script>
export default {
  data(){
    return {
      form:{
        name: "",
        password: ""
      }
    }
  },
  methods:{
    nn(){
      console.log(this.form.name,this.form.password);

      this.$refs.xx.reset()
    }
  }
}
</script>

<style>

</style>